import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class AhuText extends StatelessWidget {
  final String text;
  final Color? color;
  final double? fontSize;
  final FontWeight? fontWeight;
  final TextOverflow? overflow;
  final TextAlign? textAlign;
  final int? maxLines;
  final double? lineHeight;
  final String? fontFamily;

  const AhuText({Key? key,
    required this.text,
    this.color = Colors.black,
    this.fontSize = 14,
    this.fontWeight = FontWeight.w600,  // regular
    this.overflow = TextOverflow.ellipsis,
    this.textAlign = TextAlign.left,
    this.maxLines,
    this.lineHeight,
    this.fontFamily
  })
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Text(
      text,
      overflow: TextOverflow.ellipsis,
      textAlign: textAlign,
      maxLines: maxLines,
      style: TextStyle(
        color: color,
        fontSize: fontSize?.sp,
        fontWeight: fontWeight,
        fontFamily: fontFamily??'AlibabaPuHuiTi',
      ),
      strutStyle: StrutStyle(
          height: lineHeight
      ),

    );
  }
}
